package com.gxljc.bear.crawler.base;

public class DolphinCrawlerConsts {
    public static final String PARAM_MYSQL_URL = "mysql.dolphin.url";
    public static final String PARAM_MYSQL_BAIKE_URL = "mysql.baike.url";
    public static final String PARAM_MYSQL_HUDONG_BAIKE_URL = "mysql.hudong.baike.url";
    public static final String PARAM_MYSQL_ANALgxljc_URL = "mysql.analgxljc.url";

    public static final String PARAM_MYSQL_NEWS_URL = "mysql.news.url";
    public static final String PARAM_MONGO_BASE_URL = "mongo.base.url";
    public static final String PARAM_PLATFORM_NAME = "platform.name";
    public static final String ORG = "gxljc";
    public static final String APP = "dolphin";

    public static final String SERV_TYPE = "rpc";
    public static final String QUERY_SERV_NAME = "CrawlerServiceRpc";

    public static final String FILE_HBASE_CONFIG = "hbase-site.xml";
    public static final String FILE_CORE_SITE = "core-site.xml";
    public static final String FILE_HDFS_SITE = "hdfs-site.xml";
    public static final String FILE_YARN_SITE = "yarn-site.xml";
    public static final String FILE_DOLPHIN_CRAWLER = "gxljc-bear-crawler-config.xml";
    public static final String FILE_COMMENT_CRAWLER = "gxljc-bear-crawler-comment-config.xml";

    // libSVM model of Baidu Baike Relation Image
    public static final String FILE_BAIKERELATIONIMAGE_MODEL = "BaikeRelationImage.model";
    // libSVM model of related movie crawler added by chs
    public static final String FILE_RELATEDMOVIE_MODEL = "RelatedMovieClassiModel.txt";

    // people ids file for fix pic list and pic error
    public static final String FILE_PEOPLEID_FIX_PICS = "peopleid_fix_pics.txt";

    public static final String MYSQL_TABLE_MOVIE_DOUBAN = "t_movie_douban";
    public static final String MYSQL_TABLE_MOVIE_DOUBAN_TEST = "t_movie_douban_test";
    public static final String MYSQL_TABLE_MOVIE_OUTLINK = "t_movie_outlink";
    public static final String MYSQL_TABLE_MOVIE_OUTLINK_TEST = "t_movie_outlink_test";
    public static final String MYSQL_TABLE_MOVIE_CLUSTER = "t_movie_cluster";
    public static final String MYSQL_TABLE_MOVIE_RELATED = "t_movie_related";
    public static final String MYSQL_TABLE_MOVIE_CLUSTER_TEST = "t_movie_cluster_test";
    public static final String MYSQL_TABLE_MOVIE_RELATED_TEST = "t_movie_related_test";
    // 新闻脉络相关表
    public static final String MYSQL_TABLE_NEWS_TITLE_KEYWORDS = "t_news_title_keywords";
    public static final String MYSQL_TABLE_NEWS_TITLE_OUTLINK = "t_news_title_outlink";
    // public static final String MYSQL_TABLE_NEWS_DETAIL = "t_news_detail";
    public static final String MYSQL_TABLE_NEWS_OUTLINK = "t_news_outlink";
    public static final String MYSQL_TABLE_NEWS_ROWKEY = "t_news_rowkey";
    public static final String MYSQL_TABLE_NEWS_CRAWLER_RECORD = "t_news_crawler_record";
    public static final String REDIS_NEWS_CURRENT_DETAIL_CRAWLER_OUTLINK_ID = "dolphin:news:other:currentDetailCrawlerOutlinkId";
    public static final String REDIS_NEWS_HISTORY_ROWKEY_EXPORT_ID = "dolphin:news:other:historyRowkeyExportId";
    // hbase 表new_doc
    public static final String HTABLE_DOLPHIN_NEWS_DOC = "gxljc.dolphin.news.doc";
    public static final String HBASE_FAMILY_BASE_INFO = "base_info";
    public static final String HBASE_QUALIFIER_URL = "url";
    public static final String HBASE_QUALIFIER_TITLE = "title";
    public static final String HBASE_QUALIFIER_CONTENT = "content";
    public static final String HBASE_QUALIFIER_RELEASE_TIME = "release_time";
    public static final String HBASE_QUALIFIER_SOURCE = "source";
    public static final String HBASE_QUALIFIER_CATEGORY = "category";
    public static final String HBASE_QUALIFIER_IMGS = "imgs";

    // 网站类相关表
    public static final String MYSQL_TABLE_SITE_OUTLINK = "t_site_outlink";
    public static final String MYSQL_TABLE_SITE_DETAIL = "t_site_detail";

    // 人物表
    public static final String MYSQL_TABLE_PEOPLE_BAIKE_TAG = "t_people_baike_tag";
    public static final String MYSQL_TABLE_PEOPLE_BAIKE_INFO = "t_people_baike_info";
    public static final String MYSQL_TABLE_HAOSO_PEOPLE = "t_haoso_people";
    public static final String MYSQL_TABLE_BAIKE_INFO = "t_baike_info";
    public static final String MYSQL_TABLE_HUDONG_BAIKE_INFO = "t_hudong_baike_info";
    public static final String MYSQL_TABLE_HAOSO_BAIKE_INFO = "t_haoso_baike_info";
    public static final String MYSQL_TABLE_PEOPLE_HUDONG_BAIKE_INFO = "t_people_hudong_baike_info";
    public static final String MYSQL_TABLE_HUDONG_TAGS = "t_tags";
    public static final String MYSQL_TABLE_BAIDU_ACCOUNT = "t_baidu_account";
    public static final String MYSQL_TABLE_SOGOU_ACCOUNT = "t_sogou_account";
    public static final String MYSQL_TABLE_PEOPLE_MOVIE = "t_people_movie";
    public static final String MYSQL_TABLE_PEOPLE_MOVIE2 = "t_people_movie2";

    public final static String MYSQL_TABLE_MOVIE_TRIPLE = "t_movie_comment_triple";
    public final static String MYSQL_TABLE_MOVIE_TOP_F = "t_movie_comment_topf";
    public final static String MYSQL_TABLE_MOVIE_TOP_FS = "t_movie_comment_topfs";

    public static final String SEPARATORS = "[。|？|！|；|：|?|!|.|#|…|;|~|:|-|\\]|\\[]";
    public static final String SUB_SEPARATORS = "[,|，|\\s]";

    public static final String MYSQL_TABLE_MOVIE_DOUBAN_COMMENT_DETAIL = "t_movie_douban_comment_detail";
    public static final String REDIS_ROLLING_NEWS_HISTORY_FORMAT = "commons:crawler:spark:news:history:%s";

    public static final String PARAM_NEWS_URL_SIZE = "news.url.size";
    public static final String PARAM_NEWS_MAX_TRY_ERROR = "news.url.try.error";

    public static final String PARAM_CRAWL_DOUBAN_CORE = "crawl.spark.douban.core"; // 豆瓣电影爬虫核数
    public static final String PARAM_CRAWL_COMMENT_CORE = "crawl.spark.comment.core"; // 豆瓣评论爬虫核数
    public static final String PARAM_ANALgxljc_PEOPLE_CORE = "serv.people.analgxljc.spark.core";

    public static final String PARAM_CRAWL_PEOPLE_DATA_SPARK_CORE = "serv.people.data.spark.core"; // 人物类爬虫核数
    public static final String PARAM_CRAWL_BAIKE_DATA_SPARK_CORE = "serv.baike.data.spark.core"; // baike爬虫核数

    public static final String PARAM_NEWS_TITLE_RUN_QUARTZ = "news.title.run.quartz"; // 新闻类TITLE定时任务，多长时间运行一次
    public static final String PARAM_NEWS_DETAIL_RUN_QUARTZ = "news.detail.run.quartz"; // 新闻类DETAIL定时任务，多长时间运行一次

    public static final String PARAM_IMAGEWEB_RESOURCE_DOMAIN = "imageweb.resource.domain";
    public static final String PARAM_IMAGEWEB_EXPLAIN_DOMAIN = "imageweb.explain.domain";

    public static final String PARAM_DETECTOR_WEB_HOST = "detector.web.host";
    public static final String PARAM_DETECTOR_WEB_TYPE = "commons";
    public static final String PARAM_DETECTOR_WEB_ID = "gxljcaccount123";

    public static final int NEWS_MAX_TITLE_LENGTH = 62; // 新闻类title长度

    public static final String STR_DELIMIT_2ND = "$";

    public static final String CRAWLER_CHANNEL_TYPE_PEOPLE = "people";// 爬虫人物类频道
    public static final String CRAWLER_CHANNEL_TYPE_HUDONG = "hudong";// 爬虫互动百科频道
    public static final String CRAWLER_CHANNEL_TYPE_HAOSO = "haoso";// 爬虫好搜百科频道
    public static final String CRAWLER_CHANNEL_TYPE_GENERAL = "general";// 爬虫通用类频道
    public static final String CRAWLER_CHANNEL_TYPE_ZHIDAO = "zhidao";// 爬虫知道类频道
    public static final String CRAWLER_CHANNEL_TYPE_SOGOU = "sogou";// 爬虫搜搜类频道
    public static final String CRAWLER_CHANNEL_TYPE_JINGYAN = "jingyan";// 爬虫百度经验频道
    public static final String CRAWLER_CHANNEL_TYPE_CNTV = "cntv"; // 爬虫cntv

    public static final String CRAWLER_GENERAL_TYPE_ZHIDAO = "zhidao";// 通用类百度知道分类
    public static final String CRAWLER_GENERAL_TYPE_BAIDU = "baidu";// 通用类百度知道分类

    public static final String TEXT_SPLIT_WORD = "\n";

    public static final String QUERY_RPC_PORT = "general.service.rpc.port";

    // 本地图片刷新字段更新
    public static final String HBASE_QUALIFIER_SAVE_IMAGE_FLAG = "save_image_sync_flag"; // hbase标识已转换为本图片的字段
    public static final String RESET_IMAGE_SYNC_FLAG = "0";

    public static final String DEFAULT_LINE_BREAK_WORD = "####"; // 默认换行符

    //SPARK JOB RUN STATUS
    public static final int RESULT_YES = 1; //SPARK JOB RUN STATUS:　yes
    public static final int RESULT_NO = 0; //SPARK JOB RUN STATUS:　no

    public static final String DEFAULT_TEXT_IMAGE_FORMAT = "<img>%s</img>"; // 默认文本内的图片信息格式化

    public static final String gxljc_SREVICE_API = "serv.restfulapi.http.url";

    public final static String MONGODB_DEFAULT_ID = "_id";


    public final static String MONGODB_ES_ACTION = "action";
    public final static String MONGODB_ES_ACTION_FLAG = "actionFlag";
    public final static String DEFAULT_MONGODB_ES_ACTION = "upsert";
    public final static int DEFAULT_MONGODB_ES_ACTION_FLAG = 0;

    public final static int SINGLE_CORE_TO_RUN_SIZE = 40; //40条以下时，使用单core爬取

    public static enum MongoDBName {
        WEIXIN("db_gxljc_weixin"),
        ITAOGAO("db_gxljc_itaogao"),;
        private final String name;

        private MongoDBName(String name) {
            this.name = name;
        }

        public String getName() {
            return name;
        }

    }

    public static enum CrawlerChannelType {
        PEOPLE("people"), HUDONG("hudong"), HAOSO("haoso"), GENERAL("general"), ZHIDAO("zhidao"),
        SOGOU("sogou"), JINGYAN("jingyan"), TVSOU("tvsou"), CNTV("cntv"), JOKE("joke"), MOVIE("movie"),
        STORY("story"), POETRY("poetry"), NEWS("news"), IZHANGCHU("izhangchu"), bear("bear"),;
        private final String name;

        private CrawlerChannelType(String name) {
            this.name = name;
        }

        public String getName() {
            return name;
        }

    }

    public static enum cookieAccount {
        WEIXIN("bear:crawler:weixin"), CBCOMCN("bear:crawler:cbcomcn");
        private final String name;

        private cookieAccount(String name) {
            this.name = name;
        }

        public String getName() {
            return name;
        }

    }


    public final static String WEIXIN_ACCOUNT_REDIS_KEY = "";

}
